<html>
	<head>
        <style type="text/css">
            @import "/dojo/dijit/themes/tundra/tundra.css";
            @import "/dojo/dojo/resources/dojo.css";
        </style>
        <script type="text/javascript">
            var dojoConfig = {
                parseOnLoad: true,
                isDebug: true,
                locale: 'ru-ru',
                debugContainerId : 'divDebug'
            };
        </script>
        <script type="text/javascript" src="/dojo/dojo/dojo.js"></script>

        <script type="text/javascript">
            
            

            //Загружаем библиотеку с кнопками
           dojo.require("dijit.form.Button");


            function helloCallback(data, ioArgs) {
                alert(data);
            }
            function helloError(data, ioArgs) {
                console.log(data);
                console.log(ioArgs);

                alert('Ошибка');
            }

        </script>
    </head>
    <body class="tundra">
        <div id="divDebug"> </div>
        <button data-dojo-type="dijit.form.Button" id="helloButton">
            Hello World!
            <script type="dojo/method" data-dojo-event="onClick">
                dojo.xhrGet({
                    url     : '/2-Hello-World.php',
                    load    : helloCallback,
                    error   : helloError,
                    content : {name : dojo.byId('name').value }
                });
            </script>
        </button>
        Ваше имя: <input type="text" id="name" />
        <hr />
        POST запросы:<br />
        <form id="fPost">
            <button data-dojo-type="dijit.form.Button" id="helloButtonPost">
            Hello World!
                <script type="dojo/method" data-dojo-event="onClick">
                    dojo.xhrPost({
                        url   : '/2-Hello-World-Post.php',
                        load  : helloCallback,
                        error : helloError,
                        form  : "fPost"
                    });
                </script>
            </button>
            Ваше имя: <input type="text" id="namePost" name="name" />
        </form>
        
    </body>
</html>